#ifndef _IFSTATEMENT_
#define _IFSTATEMENT_

#include "Expression.h"
#include "Statement.h"

class IfStatement: public Statement
{
public:
    IfStatement(TreeNode* iCondition, TreeNode* iThenPart, TreeNode* iElsePart = 0);
    virtual ~IfStatement();
    virtual void CheckVariables(set<string>& oVariables, string iParentName);
    virtual void CheckFunctionCalls(set<FunctionDefinition*>& iAllFunctions, string iParentName);
    virtual void CheckClassConstructions(set<ClassDefinition*>& iAllClasses, string iParentName);
    virtual void CheckExpressionTypes(map<string, ExpressionType*>& iVarTypes, string iParentName);
    virtual void Accept(GeneralVisitor* iVisitor);
    virtual ReturnStatement* GetFirstReturnStatement();

    TreeNode* GetCondition()    { return fCondition;    }
    TreeNode* GetThenPart()     { return fThenPart;     }
    TreeNode* GetElsePart()     { return fElsePart;     }

private:
    TreeNode* fCondition;
    TreeNode* fThenPart;
    TreeNode* fElsePart;
};

#endif
